package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusContractInvoiceMapper;
import com.ruoyi.business.domain.BusContractInvoice;
import com.ruoyi.business.service.IBusContractInvoiceService;

/**
 * 合同开票Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class BusContractInvoiceServiceImpl implements IBusContractInvoiceService 
{
    @Autowired
    private BusContractInvoiceMapper busContractInvoiceMapper;

    /**
     * 查询合同开票
     * 
     * @param invoiceId 合同开票主键
     * @return 合同开票
     */
    @Override
    public BusContractInvoice selectBusContractInvoiceByInvoiceId(Long invoiceId)
    {
        return busContractInvoiceMapper.selectBusContractInvoiceByInvoiceId(invoiceId);
    }

    /**
     * 查询合同开票列表
     * 
     * @param busContractInvoice 合同开票
     * @return 合同开票
     */
    @Override
    public List<BusContractInvoice> selectBusContractInvoiceList(BusContractInvoice busContractInvoice)
    {
        return busContractInvoiceMapper.selectBusContractInvoiceList(busContractInvoice);
    }

    /**
     * 新增合同开票
     * 
     * @param busContractInvoice 合同开票
     * @return 结果
     */
    @Override
    public int insertBusContractInvoice(BusContractInvoice busContractInvoice)
    {
        busContractInvoice.setCreateTime(DateUtils.getNowDate());
        return busContractInvoiceMapper.insertBusContractInvoice(busContractInvoice);
    }

    /**
     * 修改合同开票
     * 
     * @param busContractInvoice 合同开票
     * @return 结果
     */
    @Override
    public int updateBusContractInvoice(BusContractInvoice busContractInvoice)
    {
        busContractInvoice.setUpdateTime(DateUtils.getNowDate());
        return busContractInvoiceMapper.updateBusContractInvoice(busContractInvoice);
    }

    /**
     * 批量删除合同开票
     * 
     * @param invoiceIds 需要删除的合同开票主键
     * @return 结果
     */
    @Override
    public int deleteBusContractInvoiceByInvoiceIds(Long[] invoiceIds)
    {
        return busContractInvoiceMapper.deleteBusContractInvoiceByInvoiceIds(invoiceIds);
    }

    /**
     * 删除合同开票信息
     * 
     * @param invoiceId 合同开票主键
     * @return 结果
     */
    @Override
    public int deleteBusContractInvoiceByInvoiceId(Long invoiceId)
    {
        return busContractInvoiceMapper.deleteBusContractInvoiceByInvoiceId(invoiceId);
    }
}
